package com.lei.zjs.web.interceptor;

import com.lei.zjs.utils.BOSContext;
import com.lei.zjs.vo.User;
import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.interceptor.MethodFilterInterceptor;

public class BOSLoginInterceptor extends MethodFilterInterceptor {

	//验证用户是否登录的拦截器
	protected String doIntercept(ActionInvocation invocation) throws Exception {
		User user = BOSContext.getLoginUser();
		if (user == null) {
			//没有登录
			return "login";
		}else {
			//已经登陆
			return invocation.invoke();
		}
	}
}
